import React, { Component } from 'react'
import Mytap from './components/Mytap'
import { Arrow } from '@react-vant/icons';

export default class Home extends Component {

  state={
    homelist:[
      {tit:'音乐1',icon:<Arrow/>},
      {tit:'音乐2',icon:<Arrow/>},
      {tit:'音乐3',icon:<Arrow/>},
      {tit:'音乐4',icon:<Arrow/>},
      {tit:'音乐5',icon:<Arrow/>},
    ],
    homelistIndex:0
  }

  //切换homelistIndex方法 payload = index
  changehomelistIndex = (index)=>{
    this.setState({homelistIndex:index})
  }

  render() {

   /*  console.log(this.state.homelist[this.state.homelistIndex].tit); */
    

    return (
      <div>
        <Mytap data={this.state.homelist}
        dataIndex={this.state.homelistIndex}
        setIndex={this.changehomelistIndex}></Mytap>
      </div>
    )
  }
}
